package com.bcx.crm.spring_boot.springMVC.myInterceptor;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ys on 2018/4/22.
 */
@Controller
@RequestMapping("/interceptorController")
public class DemoController {
    @RequestMapping(value = "/api",name = "测试拦截器")
    @ResponseBody
    public List<String> getSomething(){
        List<String> list = new ArrayList<>();
        list.add("aa");
        list.add("aa1");
        list.add("aa2");
        if (list.size()>0){
            throw new NullPointerException("");
        }
        return list;
    }
}
